public class t55 {
    public static void main(String[] args) {
        //int arr[] = {2,3,1,1,4};
        int arr [] = {2,0,0};
        int n = arr.length;
        /*if(n == 1){
            return true;
        }*/
        boolean dp [] = new boolean[n];
        dp[0] = true;
        for(int i =1;i<n;i++){
            dp[i] = false;
            for(int j =0;j<i;j++){
                if(i-j<=arr[j] && dp[j]){
                    dp[i]=true;
                    break;
                }
            }
        }
        //return dp[n];
        System.out.println(dp[n-1]);
    }
}
